/*
 *   Copyright (c) 2010-2022, SIUFUNG
 */
package net.siufung.market.base.dict.mapper.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 字典数据
 *
 * @author 陈建峰
 * @since 2022-07-08 15:30:15
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("data_dict")
public class Dict implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 字典id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 字典编码
     */
    @TableField("dict_code")
    @NotBlank(message = "字典编码不能为空!")
    @Length(max=64, message="字典编码长度不大于64!")
    private String dictCode;

    /**
     * 字典值
     */
    @TableField("dict_value")
    @NotBlank(message = "字典值不能为空!")
    @Length(max=64, message="字典值长度不大于64!")
    private String dictValue;

    /**
     * 类型
     */
    @TableField("dict_type_id")
    @NotNull(message = "字典类型不能为空！")
    private Integer dictTypeId;

    /**
     * 类型
     */
    @TableField("dict_type_code")
    @NotBlank(message = "字典类型不能为空！")
    @Length(max=32, message="字典类型编码长度不大于32!")
    private String dictTypeCode;

    /**
     * 是否默认
     */
    @TableField("default_flag")
    @NotNull(message = "默认状态不能为空！")
    private Boolean defaultFlag;

    /**
     * 备注
     */
    @TableField("description")
    @Length(max=100, message="备注长度不大于100!")
    private String description;

    /**
     * 租户
     */
    @TableField("tenant_id")
    private String tenantId;

    /**
     * 创建人
     */
    @TableField(value = "created_by", fill = FieldFill.INSERT)
    private String createdBy;

    /**
     * 创建时间
     */
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    /**
     * 更新人
     */
    @TableField(value = "updated_by", fill = FieldFill.UPDATE)
    private String updatedBy;

    /**
     * 更新时间
     */
    @TableField(value = "updated_at", fill = FieldFill.UPDATE)
    private LocalDateTime updatedAt;

    /**
     * 数据标识
     */
    @TableField(value = "deleted", fill = FieldFill.INSERT)
    private Boolean deleted;


}
